﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Master Pages/Site.Master" AutoEventWireup="true" CodeBehind="PickSpot.aspx.cs" Inherits="parkour.Web_pages.Public_Pages.PickSpot" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <h1>Please choose a Parking Lot and a Spot</h1>
    <br /><br />
   
   <asp:TextBox ID="test" runat="server" Visible="false" ></asp:TextBox>

    <%--List to pick a parking lot --%>
    <asp:SqlDataSource ID="SqlLotName" runat="server" ConnectionString='<%$ connectionStrings:SEI_PKConnString %>'
                       SelectCommandType="StoredProcedure" 
                       SelectCommand="get_parking_lot_name">
    <SelectParameters>
       <asp:ControlParameter Name="user_ID" ControlID="test" />
    </SelectParameters>

    </asp:SqlDataSource>
    
    <asp:Label ID="LotNameLabel" AssociatedControlID="LotName" runat="server" Text="Pick a Parking Lot: "></asp:Label>
    <asp:DropDownList ID="LotName" runat="server" AutoPostBack="True" Width="165px" 
                      DataSourceID="SqlLotName"   DataTextField="l_name" DataValueField="l_ID">
    </asp:DropDownList>
    <br /><br />

   <%--List to pick a parking spot --%>
   <asp:SqlDataSource ID="sqlSpotNumber" runat="server" ConnectionString='<%$ connectionStrings:SEI_PKConnString %>'
                      SelectCommandType="StoredProcedure" SelectCommand="get_parking_spot_number">
      <SelectParameters>
         <asp:ControlParameter Name="lot_ID" ControlID="LotName" />
      </SelectParameters>
    </asp:SqlDataSource>
    <asp:Label ID="SpotNumberLabel" AssociatedControlID="SpotNumber" runat="server" Text="Pick a Parking spot: "></asp:Label>
    <asp:DropDownList ID="SpotNumber" runat="server" AutoPostBack="True" Width="165px" DataSourceID="SqlSpotNumber" 
                      DataTextField="p_number" DataValueField="p_id">
    </asp:DropDownList> 
    <br /><br />
    <asp:Button ID="Button1" runat="server" Text="Go view map" 
       onclick="Button1_Click" />
    
    <asp:Button ID="Button2" runat="server" onclick="Button2_Click" 
       Text="Pick spot" />
    
</asp:Content>


<%-- <span class="mandatory">*</span>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator14" runat="server" ControlToValidate="ddlout"
                    ErrorMessage=" Required." InitialValue="Please select one..." ForeColor="Red"
                    SetFocusOnError="true"></asp:RequiredFieldValidator>--%>